/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eu.epfc.dnet.mastermind.model.beans;

/**
 *
 * @author Pierre Buvé & Nicolas Van Damme
 */
public class RankingBean implements Comparable {
    
    private String username;
    private int duration;
    private String time;

    public int getDuration() {
        return duration;
    }

    public String getUsername() {
        return username;
    }

    public String getTime() {
        return time;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setTime(String time) {
        this.time = time;
    }

    @Override
    public int compareTo(Object o) {
        int nombre1 = ((RankingBean)o).getDuration();
        int nombre2 = this.getDuration();
      if (nombre1 > nombre2)  return -1; 
      else if(nombre1 == nombre2) return 0; 
      else return 1;
    }
    
    
}
